<template>
<div id="mains">
    <header class="we-header">
        <i class="fa fa-chevron-left" @click='$router.push("/home")'></i>
        <h3>wechat page</h3>
    </header>
    <div class="api-t api-st">
        apiList - length: {{$store.state.wechat.apiList.length}}
    </div>
    <div id="contents" class="animate">
        <ul>
            <li v-for="item in $store.state.wechat.apiList" :key="item.id">
                <p class="api-name">{{item.name}}</p>
                <p class="api-url">
                    <a :href="item.apiUrl" target="_blank">{{item.apiUrl}}</a>
                </p>
            </li>
        </ul>
    </div>
</div>
</template>

<script>
export default {
    name: "wechat",
    mounted() {
        this.getApiList()
    },
    methods: {
        // 获取发现对象
        getApiList() {
            this.$store.dispatch("wechat/getApiList")
        }
    },
}
</script>

<style scoped>
#mains {
    margin-bottom: 0;
    background-color: #d4e3f8;
}
#mains .we-header {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid #b3b2b2;
    background-color: #54ffe8;
    text-align: center;
    box-shadow: 0 2px 6px #b3b2b2;
}
#mains .we-header>i {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    line-height: 50px;
    background-color: #b7eeff;
}
#mains .we-header>i:hover {
    background-color: #59d8ff;
}
#mains .we-header>h3 {
    width: 100%;
    height: 50px;
    line-height: 50px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-left: 50px;
    padding-right: 50px;
}
#mains .api-t,
#contents ul li .api-url {
    min-height: 40px;
    margin-top: 5px;
    padding: 5px 15px;
    border: 1px solid #acacac;
    border-radius: 10px;
    word-wrap: break-word;
    font-weight: bold;
    text-align: center;
    color: red;
}
#mains .api-st {
    font-size:30px;
    line-height:35px;
    box-shadow: 0 0 6px #8f8e8e;
}
#contents {
    margin-bottom: 0;
}
#contents ul {
    word-wrap: break-word;
    padding: 0 10px 5px;
}
#contents ul li {
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #62c3ff;
    border-radius: 5px;
    box-shadow: 0 0 4px #11a4ff;
}
#contents ul li .api-name {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    color: red;
}
#contents ul li .api-url {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 40px;
    box-shadow: 0 0 3px #8f8e8e;
    transition: all .25s ease;
}
#contents ul li .api-url>a {
    color: #0081d6;
}
#contents ul li .api-url:hover {
    box-shadow: 0 0 20px #006eff;
    cursor: pointer;
}
#contents ul li .api-url:hover>a {
    color: red;
}
</style>